# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=jack
pkgver=1.9.22
pkgrel=4
pkgdesc="The Jack Audio Connection Kit"
url="https://jackaudio.org/"
arch="all"
license="GPL-2.0-or-later"
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="
	alsa-lib-dev
	dbus-dev
	expat-dev
	libsamplerate-dev
	libsndfile-dev
	linux-headers
	ncurses-dev
	python3
	readline-dev
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbus"
source="https://github.com/jackaudio/jack2/archive/v$pkgver/jack2-v$pkgver.tar.gz
	fix-execinfo.patch
	increase-api-version.patch
	"
builddir="$srcdir/jack2-$pkgver"
options="!check" # no real tests provided

build() {
	./waf configure \
		--prefix=/usr \
		--mandir=/usr/share/man/man1 \
		--libdir=/usr/lib \
		--dbus \
		--alsa \
		--classic

	./waf build -v
}

package() {
	./waf --destdir="$pkgdir" install
}

dbus() {
	pkgdesc="Jack D-Bus launcher"

	amove usr/bin/jackdbus
	amove usr/share/dbus*
}

sha512sums="
d93cb2bcc57b72b6815eed143de1092d14fe22542ae9a1f8480d9ed5f44b59c50f81279d18bdd84ff6276ddd71ca1aa64a1e46d61199a5eda0d873a356194ab4  jack2-v1.9.22.tar.gz
b5abec7e67485d1c13f399b5961539177dd35d21c5dd95e0aa767adb0f5b1e588e9ca2f9b29cc4d66fc039311ff7eacc4cf21f6700ef0a2c8de99b63cb00f84d  fix-execinfo.patch
1ee0159ea0f75f964baa167fe13031fe82e04b31a1b14122c12161d103e1a3205061fc019bcd978f47eed6efc8ea6ee96188c0eb795e3d83f34481e193086fbe  increase-api-version.patch
"
